cc.Class({
    extends: cc.Component,

    properties: {
    },

    onLoad: function () {
        window.uiMgr = this;
        var children = this.node.children;
        if (children) {
            for (var child of children) {
                child.active = false;
            }
        }
    },

    open: function (name) {
        var ui = this.node.getChildByName(name);
        if (ui) {
            ui.active = true;
        }
    },

    close: function (name, except) {
        var ui = this.node.getChildByName(name);
        if (ui) {
            ui.active = false;
        }
    },

    closeAllExcept: function (except, forceOpen) {
        if (except) {
            var children = this.node.children;
            if (children) {
                for (var child of children) {
                    if (child) {
                        var close = true;
                        for (var j = 0; j < except.length; j++) {
                            if (child.name == except[j]) {
                                close = false;
                                break;
                            }
                        }
                        if (close) {
                            child.active = false;
                        } else if (forceOpen) {
                            child.active = true;
                        }
                    }
                }
            }
        }
    },

    openTips: function (content) {

    },

    openConfirm: function (title, content, double, onConfirmed, onCanceled) {

    },

    closeConfirm: function () { },

    openProgress: function (content) { },

    closeProgress: function () { }
});
